<template>
    <el-sub-menu :index="permission.resourceCode" v-if="permission.resourceType == 'D'">
        <template #title>
            <!-- <el-icon>
                <location />
            </el-icon> -->
            <span>{{ permission.resourceName }}</span>
        </template>
        <menu-itrator v-for="(item) in permission.sonList" :permission = "item"></menu-itrator>
    </el-sub-menu>
    <el-menu-item :index="permission.resourceCode" v-else-if="permission.resourceType == 'M'" @click="toPage(permission.extInfo.name)">
        <!-- <el-icon><icon-menu /></el-icon> -->
        <span>{{ permission.resourceName }}</span>
    </el-menu-item>
</template>

<script setup lang='ts'>

import router from '@/router';
import { useRoute } from 'vue-router';

const path = useRoute().path + '/'
const props = defineProps<{
    permission:any;
}>();

//路由跳转
function toPage(routeName : string){
    router.push({name:routeName})
}

</script>

<style></style>